package com.esri.core.geometry;

import com.esri.core.geometry.Geometry;

/* loaded from: classes.dex */
public abstract class MultiVertexGeometryImpl extends MultiVertexGeometry {
    private static final long serialVersionUID = 1;
    AttributeStreamBase[] b;
    Envelope d;
    protected double m_simpleTolerance;
    protected int m_flagsMask = 65535;
    protected int m_pointCount = 0;
    protected int m_reservedPointCount = -1;
    GeometryAccelerators c = null;

    /* loaded from: classes.dex */
    public interface DirtyFlags {
        public static final int DirtyAll = 16777215;
        public static final int DirtyAllInternal = 65535;
        public static final int DirtyArea2D = 256;
        public static final int DirtyCoordinates = 1013;
        public static final int DirtyExactIntervals = 16;
        public static final int DirtyIntervals = 48;
        public static final int DirtyIsEnvelope = 64;
        public static final int DirtyIsKnownSimple = 1;
        public static final int DirtyLength2D = 128;
        public static final int DirtyOGCFlags = 4;
        public static final int DirtyRingAreas2D = 512;
        public static final int DirtyVerifiedStreams = 8;
        public static final int IsWeakSimple = 2;
    }

    /* loaded from: classes.dex */
    public interface GeometryXSimple {
        public static final int Not = 0;
        public static final int Strong = 2;
        public static final int Unknown = -1;
        public static final int Weak = 1;
    }

    public abstract boolean _buildRasterizedGeometryAccelerator(double d, Geometry.GeometryAccelerationDegree geometryAccelerationDegree);

    protected abstract void _notifyModifiedAllImpl();

    protected abstract void _verifyStreamsImpl();

    abstract void a(MultiVertexGeometryImpl multiVertexGeometryImpl);

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public int getPointCount() {
        return this.m_pointCount;
    }

    @Override // com.esri.core.geometry.Geometry
    public boolean isEmpty() {
        return b();
    }

    public VertexDescription getDescriptionImpl() {
        return this.m_description;
    }

    public boolean b() {
        return this.m_pointCount == 0;
    }

    @Override // com.esri.core.geometry.Geometry
    public boolean isValid() {
        return !isEmpty();
    }

    public boolean _hasDirtyFlag(int i) {
        return (i & this.m_flagsMask) != 0;
    }

    public void _setDirtyFlag(int i, boolean z) {
        if (z) {
            this.m_flagsMask = i | this.m_flagsMask;
            return;
        }
        this.m_flagsMask = (i ^ (-1)) & this.m_flagsMask;
    }

    public void _verifyAllStreams() {
        if (_hasDirtyFlag(8)) {
            _verifyAllStreamsImpl();
        }
    }

    public void throwIfEmpty() {
        if (b()) {
            throw new GeometryException("This operation was performed on an Empty Geometry.");
        }
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void a(int i, Point point) {
        if (i < 0 || i >= this.m_pointCount) {
            throw new GeometryException("index out of bounds");
        }
        _verifyAllStreams();
        point.a(this.m_description);
        if (point.isEmpty()) {
            point.k();
        }
        for (int i2 = 0; i2 < this.m_description.getAttributeCount(); i2++) {
            int _getSemanticsImpl = this.m_description._getSemanticsImpl(i2);
            int componentCount = VertexDescription.getComponentCount(_getSemanticsImpl);
            for (int i3 = 0; i3 < componentCount; i3++) {
                point.a(_getSemanticsImpl, i3, this.b[i2].readAsDbl((componentCount * i) + i3));
            }
        }
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void setPointByVal(int i, Point point) {
        if (i < 0 || i >= this.m_pointCount) {
            throw new GeometryException("index out of bounds");
        }
        if (point.isEmpty()) {
            throw new IllegalArgumentException();
        }
        _verifyAllStreams();
        VertexDescription description = point.getDescription();
        for (int i2 = 0; i2 < description.getAttributeCount(); i2++) {
            int _getSemanticsImpl = description._getSemanticsImpl(i2);
            int componentCount = VertexDescription.getComponentCount(_getSemanticsImpl);
            for (int i3 = 0; i3 < componentCount; i3++) {
                setAttribute(_getSemanticsImpl, i, i3, point.a(_getSemanticsImpl, i3));
            }
        }
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public Point2D getXY(int i) {
        Point2D point2D = new Point2D();
        getXY(i, point2D);
        return point2D;
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void getXY(int i, Point2D point2D) {
        if (i < 0 || i >= getPointCount()) {
            throw new IndexOutOfBoundsException();
        }
        _verifyAllStreams();
        ((AttributeStreamOfDbl) this.b[0]).read(i * 2, point2D);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void setXY(int i, Point2D point2D) {
        if (i < 0 || i >= this.m_pointCount) {
            throw new IndexOutOfBoundsException();
        }
        _verifyAllStreams();
        ((AttributeStreamOfDbl) this.b[0]).a(i * 2, point2D);
        notifyModified(1013);
    }

    public void setXY(int i, double d, double d2) {
        if (i < 0 || i >= this.m_pointCount) {
            throw new IndexOutOfBoundsException();
        }
        _verifyAllStreams();
        AttributeStreamOfDbl attributeStreamOfDbl = (AttributeStreamOfDbl) this.b[0];
        int i2 = i * 2;
        attributeStreamOfDbl.write(i2, d);
        attributeStreamOfDbl.write(i2 + 1, d2);
        notifyModified(1013);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public Point3D getXYZ(int i) {
        if (i < 0 || i >= getPointCount()) {
            throw new IndexOutOfBoundsException();
        }
        _verifyAllStreams();
        AttributeStreamOfDbl attributeStreamOfDbl = (AttributeStreamOfDbl) this.b[0];
        Point3D point3D = new Point3D();
        int i2 = i * 2;
        point3D.x = attributeStreamOfDbl.read(i2);
        point3D.y = attributeStreamOfDbl.read(i2 + 1);
        if (e(1)) {
            point3D.z = this.b[1].readAsDbl(i);
        } else {
            point3D.z = VertexDescription.getDefaultValue(1);
        }
        return point3D;
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void setXYZ(int i, Point3D point3D) {
        if (i < 0 || i >= getPointCount()) {
            throw new IndexOutOfBoundsException();
        }
        addAttribute(1);
        _verifyAllStreams();
        notifyModified(1013);
        AttributeStreamOfDbl attributeStreamOfDbl = (AttributeStreamOfDbl) this.b[0];
        int i2 = i * 2;
        attributeStreamOfDbl.write(i2, point3D.x);
        attributeStreamOfDbl.write(i2 + 1, point3D.y);
        this.b[1].writeAsDbl(i, point3D.z);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public double getAttributeAsDbl(int i, int i2, int i3) {
        if (i2 < 0 || i2 >= this.m_pointCount) {
            throw new IndexOutOfBoundsException();
        }
        int componentCount = VertexDescription.getComponentCount(i);
        if (i3 >= componentCount) {
            throw new IndexOutOfBoundsException();
        }
        _verifyAllStreams();
        int attributeIndex = this.m_description.getAttributeIndex(i);
        if (attributeIndex >= 0) {
            return this.b[attributeIndex].readAsDbl((i2 * componentCount) + i3);
        }
        return VertexDescription.getDefaultValue(i);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public int getAttributeAsInt(int i, int i2, int i3) {
        return (int) getAttributeAsDbl(i, i2, i3);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void setAttribute(int i, int i2, int i3, double d) {
        if (i2 < 0 || i2 >= this.m_pointCount) {
            throw new IndexOutOfBoundsException();
        }
        int componentCount = VertexDescription.getComponentCount(i);
        if (i3 >= componentCount) {
            throw new IndexOutOfBoundsException();
        }
        addAttribute(i);
        _verifyAllStreams();
        int attributeIndex = this.m_description.getAttributeIndex(i);
        notifyModified(1013);
        this.b[attributeIndex].writeAsDbl((i2 * componentCount) + i3, d);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void setAttribute(int i, int i2, int i3, int i4) {
        setAttribute(i, i2, i3, i4);
    }

    public AttributeStreamBase getAttributeStreamRef(int i) {
        throwIfEmpty();
        addAttribute(i);
        _verifyAllStreams();
        return this.b[this.m_description.getAttributeIndex(i)];
    }

    public void setAttributeStreamRef(int i, AttributeStreamBase attributeStreamBase) {
        if (attributeStreamBase != null && VertexDescription.getPersistence(i) != attributeStreamBase.getPersistence()) {
            throw new IllegalArgumentException();
        }
        addAttribute(i);
        int attributeIndex = this.m_description.getAttributeIndex(i);
        if (this.b == null) {
            this.b = new AttributeStreamBase[this.m_description.getAttributeCount()];
        }
        this.b[attributeIndex] = attributeStreamBase;
        notifyModified(16777215);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry, com.esri.core.geometry.Geometry
    void b(int i) {
        AttributeStreamBase[] attributeStreamBaseArr;
        i();
        int attributeIndex = this.m_description.getAttributeIndex(i);
        if (this.b != null) {
            attributeStreamBaseArr = new AttributeStreamBase[this.m_description.getAttributeCount() - 1];
            for (int i2 = 0; i2 < attributeIndex; i2++) {
                attributeStreamBaseArr[i2] = this.b[i2];
            }
            while (true) {
                attributeIndex++;
                if (attributeIndex >= this.m_description.getAttributeCount()) {
                    break;
                }
                attributeStreamBaseArr[attributeIndex - 1] = this.b[attributeIndex];
            }
        } else {
            attributeStreamBaseArr = null;
        }
        this.b = attributeStreamBaseArr;
        notifyModified(16777215);
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry, com.esri.core.geometry.Geometry
    void c(int i) {
        AttributeStreamBase[] attributeStreamBaseArr;
        i();
        int attributeIndex = this.m_description.getAttributeIndex(i);
        if (this.b != null) {
            attributeStreamBaseArr = new AttributeStreamBase[this.m_description.getAttributeCount()];
            if (this.b != null) {
                for (int i2 = 0; i2 < attributeIndex; i2++) {
                    attributeStreamBaseArr[i2] = this.b[i2];
                }
                while (true) {
                    attributeIndex++;
                    if (attributeIndex >= this.m_description.getAttributeCount()) {
                        break;
                    }
                    attributeStreamBaseArr[attributeIndex] = this.b[attributeIndex - 1];
                }
            }
        } else {
            attributeStreamBaseArr = null;
        }
        this.b = attributeStreamBaseArr;
        this.m_reservedPointCount = -1;
        notifyModified(16777215);
    }

    protected void _updateEnvelope(Envelope2D envelope2D) {
        _updateAllDirtyIntervals(true);
        this.d.queryEnvelope2D(envelope2D);
    }

    protected void _updateEnvelope(Envelope3D envelope3D) {
        _updateAllDirtyIntervals(true);
        this.d.queryEnvelope3D(envelope3D);
    }

    protected void _updateLooseEnvelope(Envelope2D envelope2D) {
        _updateAllDirtyIntervals(false);
        this.d.queryEnvelope2D(envelope2D);
    }

    protected void _updateLooseEnvelope(Envelope3D envelope3D) {
        _updateAllDirtyIntervals(false);
        this.d.queryEnvelope3D(envelope3D);
    }

    @Override // com.esri.core.geometry.Geometry
    public void queryEnvelope(Envelope envelope) {
        _updateAllDirtyIntervals(true);
        this.d.copyTo(envelope);
    }

    @Override // com.esri.core.geometry.Geometry
    public void queryEnvelope2D(Envelope2D envelope2D) {
        _updateEnvelope(envelope2D);
    }

    @Override // com.esri.core.geometry.Geometry
    public void queryEnvelope3D(Envelope3D envelope3D) {
        _updateEnvelope(envelope3D);
    }

    @Override // com.esri.core.geometry.Geometry
    public void queryLooseEnvelope2D(Envelope2D envelope2D) {
        _updateLooseEnvelope(envelope2D);
    }

    @Override // com.esri.core.geometry.Geometry
    public void queryLooseEnvelope3D(Envelope3D envelope3D) {
        _updateLooseEnvelope(envelope3D);
    }

    @Override // com.esri.core.geometry.Geometry
    public Envelope1D queryInterval(int i, int i2) {
        Envelope1D envelope1D = new Envelope1D();
        if (b()) {
            envelope1D.setEmpty();
            return envelope1D;
        }
        _updateAllDirtyIntervals(true);
        return this.d.queryInterval(i, i2);
    }

    public int hashCode() {
        int hashCode = this.m_description.hashCode();
        if (!b()) {
            int pointCount = getPointCount();
            int attributeCount = this.m_description.getAttributeCount();
            for (int i = 0; i < attributeCount; i++) {
                hashCode = this.b[i].calculateHashImpl(hashCode, 0, VertexDescription.getComponentCount(this.m_description._getSemanticsImpl(i)) * pointCount);
            }
        }
        return hashCode;
    }

    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof MultiVertexGeometryImpl) {
            MultiVertexGeometryImpl multiVertexGeometryImpl = (MultiVertexGeometryImpl) obj;
            if (this.m_description.equals(multiVertexGeometryImpl.m_description) && b() == multiVertexGeometryImpl.b()) {
                if (b()) {
                    return true;
                }
                int pointCount = getPointCount();
                if (pointCount != multiVertexGeometryImpl.getPointCount()) {
                    return false;
                }
                for (int i = 0; i < this.m_description.getAttributeCount(); i++) {
                    int semantics = this.m_description.getSemantics(i);
                    if (!getAttributeStreamRef(semantics).equals(multiVertexGeometryImpl.getAttributeStreamRef(semantics), 0, VertexDescription.getComponentCount(semantics) * pointCount)) {
                        return false;
                    }
                }
                return true;
            }
            return false;
        }
        return false;
    }

    public void setEnvelope(Envelope envelope) {
        if (!this.m_description.equals(envelope.getDescription())) {
            throw new IllegalArgumentException();
        }
        Envelope envelope2 = (Envelope) envelope.createInstance();
        this.d = envelope2;
        envelope.copyTo(envelope2);
        _setDirtyFlag(48, false);
    }

    @Override // com.esri.core.geometry.Geometry
    public void copyTo(Geometry geometry) {
        AttributeStreamBase[] attributeStreamBaseArr;
        MultiVertexGeometryImpl multiVertexGeometryImpl = (MultiVertexGeometryImpl) geometry;
        if (multiVertexGeometryImpl.getType() != getType()) {
            throw new IllegalArgumentException();
        }
        _verifyAllStreams();
        multiVertexGeometryImpl.m_description = this.m_description;
        multiVertexGeometryImpl.b = null;
        int attributeCount = this.m_description.getAttributeCount();
        if (this.b != null) {
            attributeStreamBaseArr = new AttributeStreamBase[attributeCount];
            for (int i = 0; i < attributeCount; i++) {
                if (this.b[i] != null) {
                    attributeStreamBaseArr[i] = this.b[i].restrictedClone(getPointCount() * VertexDescription.getComponentCount(this.m_description._getSemanticsImpl(i)));
                }
            }
        } else {
            attributeStreamBaseArr = null;
        }
        Envelope envelope = this.d;
        if (envelope != null) {
            Envelope envelope2 = (Envelope) envelope.createInstance();
            multiVertexGeometryImpl.d = envelope2;
            this.d.copyTo(envelope2);
        } else {
            multiVertexGeometryImpl.d = null;
        }
        multiVertexGeometryImpl.m_pointCount = this.m_pointCount;
        multiVertexGeometryImpl.m_flagsMask = this.m_flagsMask;
        multiVertexGeometryImpl.b = attributeStreamBaseArr;
        try {
            a(multiVertexGeometryImpl);
        } catch (Exception e) {
            multiVertexGeometryImpl.setEmpty();
            throw new RuntimeException(e);
        }
    }

    public boolean _attributeStreamIsAllocated(int i) {
        throwIfEmpty();
        int attributeIndex = this.m_description.getAttributeIndex(i);
        return attributeIndex >= 0 && this.b[attributeIndex] != null;
    }

    public void l() {
        this.m_pointCount = 0;
        this.m_reservedPointCount = -1;
        this.b = null;
        notifyModified(16777215);
    }

    public void notifyModified(int i) {
        if (i == 16777215) {
            this.m_reservedPointCount = -1;
            _notifyModifiedAllImpl();
        }
        this.m_flagsMask = i | this.m_flagsMask;
        n();
        i();
    }

    protected void _updateAllDirtyIntervals(boolean z) {
        _verifyAllStreams();
        if (_hasDirtyFlag(48)) {
            Envelope envelope = this.d;
            if (envelope == null) {
                this.d = new Envelope(this.m_description);
            } else {
                envelope.a(this.m_description);
            }
            if (isEmpty()) {
                this.d.setEmpty();
                return;
            }
            _updateXYImpl(z);
            for (int i = 1; i < this.m_description.getAttributeCount(); i++) {
                int _getSemanticsImpl = this.m_description._getSemanticsImpl(i);
                int componentCount = VertexDescription.getComponentCount(_getSemanticsImpl);
                AttributeStreamBase attributeStreamBase = this.b[i];
                for (int i2 = 0; i2 < componentCount; i2++) {
                    Envelope1D envelope1D = new Envelope1D();
                    envelope1D.setEmpty();
                    for (int i3 = 0; i3 < this.m_pointCount; i3++) {
                        envelope1D.merge(attributeStreamBase.readAsDbl((i3 * componentCount) + i2));
                    }
                    this.d.a(_getSemanticsImpl, i2, envelope1D);
                }
            }
            if (z) {
                _setDirtyFlag(48, false);
            }
        }
    }

    public void _updateXYImpl(boolean z) {
        this.d.setEmpty();
        AttributeStreamOfDbl attributeStreamOfDbl = (AttributeStreamOfDbl) this.b[0];
        Point2D point2D = new Point2D();
        for (int i = 0; i < this.m_pointCount; i++) {
            attributeStreamOfDbl.read(i * 2, point2D);
            this.d.a(point2D);
        }
    }

    protected void _verifyAllStreamsImpl() {
        if (this.m_reservedPointCount < this.m_pointCount) {
            if (this.b == null) {
                this.b = new AttributeStreamBase[this.m_description.getAttributeCount()];
            }
            this.m_reservedPointCount = NumberUtils.intMax();
            for (int i = 0; i < this.m_description.getAttributeCount(); i++) {
                int _getSemanticsImpl = this.m_description._getSemanticsImpl(i);
                AttributeStreamBase[] attributeStreamBaseArr = this.b;
                if (attributeStreamBaseArr[i] != null) {
                    int componentCount = VertexDescription.getComponentCount(_getSemanticsImpl);
                    int virtualSize = this.b[i].virtualSize() / componentCount;
                    int i2 = this.m_pointCount;
                    if (virtualSize < i2) {
                        if (this.m_reservedPointCount > i2 + 5) {
                            i2 = ((i2 * 5) + 3) / 4;
                        }
                        virtualSize = i2;
                        this.b[i].resize(componentCount * virtualSize, VertexDescription.getDefaultValue(_getSemanticsImpl));
                    }
                    if (virtualSize < this.m_reservedPointCount) {
                        this.m_reservedPointCount = virtualSize;
                    }
                } else {
                    attributeStreamBaseArr[i] = AttributeStreamBase.createAttributeStreamWithSemantics(_getSemanticsImpl, this.m_pointCount);
                    this.m_reservedPointCount = this.m_pointCount;
                }
            }
        }
        _verifyStreamsImpl();
        _setDirtyFlag(8, false);
    }

    public void d(int i) {
        if (i < 0) {
            throw new IllegalArgumentException();
        }
        if (i == this.m_pointCount) {
            return;
        }
        this.m_pointCount = i;
        notifyModified(65535);
    }

    int a(Point2D[] point2DArr, int i, int i2, int i3) {
        if (i3 < 0) {
            i3 = this.m_pointCount;
        }
        int min = Math.min(i3, i + i2);
        if (i2 < 0 || i2 >= this.m_pointCount || min < i2) {
            throw new IllegalArgumentException();
        }
        AttributeStreamOfDbl attributeStreamOfDbl = (AttributeStreamOfDbl) getAttributeStreamRef(0);
        double[] dArr = new double[point2DArr.length * 2];
        attributeStreamOfDbl.readRange(i2 * 2, min - i2, dArr, 0, true);
        for (int i4 = 0; i4 < point2DArr.length; i4++) {
            int i5 = i4 * 2;
            point2DArr[i4] = new Point2D(dArr[i5], dArr[i5 + 1]);
        }
        return min;
    }

    int a(Point3D[] point3DArr, int i, int i2, int i3) {
        if (i3 < 0) {
            i3 = this.m_pointCount;
        }
        int min = Math.min(i3, i + i2);
        if (i2 < 0 || i2 >= this.m_pointCount || min < i2) {
            throw new IllegalArgumentException();
        }
        int i4 = 0;
        AttributeStreamOfDbl attributeStreamOfDbl = (AttributeStreamOfDbl) getAttributeStreamRef(0);
        double defaultValue = VertexDescription.getDefaultValue(1);
        boolean e = e(1);
        AttributeStreamOfDbl attributeStreamOfDbl2 = e ? (AttributeStreamOfDbl) getAttributeStreamRef(1) : null;
        while (i2 < min) {
            int i5 = i2 * 2;
            point3DArr[i4].x = attributeStreamOfDbl.read(i5);
            point3DArr[i4].y = attributeStreamOfDbl.read(i5 + 1);
            point3DArr[i4].z = e ? attributeStreamOfDbl2.read(i2) : defaultValue;
            point3DArr[i4] = getXYZ(i2);
            i2++;
            i4++;
        }
        return min;
    }

    public int getIsSimple(double d) {
        if (!_hasDirtyFlag(1)) {
            if (!_hasDirtyFlag(2)) {
                return 0;
            }
            if (this.m_simpleTolerance >= d) {
                return !_hasDirtyFlag(4) ? 2 : 1;
            }
        }
        return -1;
    }

    public void a(int i, double d) {
        this.m_simpleTolerance = d;
        if (i == -1) {
            _setDirtyFlag(1, true);
            _setDirtyFlag(4, true);
            return;
        }
        _setDirtyFlag(1, false);
        if (i == 0) {
            _setDirtyFlag(2, false);
            _setDirtyFlag(4, true);
        } else if (i == 1) {
            _setDirtyFlag(2, true);
            _setDirtyFlag(4, true);
        } else if (i == 2) {
            _setDirtyFlag(2, true);
            _setDirtyFlag(4, false);
        } else {
            throw new GeometryException("internal error");
        }
    }

    double m() {
        return this.m_simpleTolerance;
    }

    public GeometryAccelerators _getAccelerators() {
        return this.c;
    }

    void n() {
        if (this.c != null) {
            this.c = null;
        }
    }

    void a(int i, int i2, double d, Point point) {
        int i3;
        if (i < 0 || i >= (i3 = this.m_pointCount)) {
            throw new GeometryException("index out of bounds.");
        }
        if (i2 < 0 || i2 >= i3) {
            throw new GeometryException("index out of bounds.");
        }
        _verifyAllStreams();
        point.a(this.m_description);
        if (point.isEmpty()) {
            point.k();
        }
        for (int i4 = 0; i4 < this.m_description.getAttributeCount(); i4++) {
            int _getSemanticsImpl = this.m_description._getSemanticsImpl(i4);
            int componentCount = VertexDescription.getComponentCount(_getSemanticsImpl);
            for (int i5 = 0; i5 < componentCount; i5++) {
                point.a(_getSemanticsImpl, i5, (this.b[i4].readAsDbl((componentCount * i) + i5) * (1.0d - d)) + (this.b[i4].readAsDbl((componentCount * i2) + i5) * d));
            }
        }
    }

    double a(int i, int i2) {
        Point2D xy = getXY(i);
        xy.sub(getXY(i2));
        return xy.length();
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public Point getPoint(int i) {
        if (i < 0 || i >= this.m_pointCount) {
            throw new IndexOutOfBoundsException();
        }
        _verifyAllStreams();
        Point point = new Point();
        point.a(this.m_description);
        if (point.isEmpty()) {
            point.k();
        }
        for (int i2 = 0; i2 < this.m_description.getAttributeCount(); i2++) {
            int semantics = this.m_description.getSemantics(i2);
            int componentCount = VertexDescription.getComponentCount(semantics);
            for (int i3 = 0; i3 < componentCount; i3++) {
                point.a(semantics, i3, this.b[i2].readAsDbl((componentCount * i) + i3));
            }
        }
        return point;
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void setPoint(int i, Point point) {
        if (i < 0 || i >= this.m_pointCount) {
            throw new IndexOutOfBoundsException();
        }
        if (point.isEmpty()) {
            throw new IllegalArgumentException();
        }
        _verifyAllStreams();
        VertexDescription description = point.getDescription();
        for (int i2 = 0; i2 < description.getAttributeCount(); i2++) {
            int semantics = description.getSemantics(i2);
            int componentCount = VertexDescription.getComponentCount(semantics);
            for (int i3 = 0; i3 < componentCount; i3++) {
                setAttribute(semantics, i, i3, point.a(semantics, i3));
            }
        }
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void queryCoordinates(Point[] pointArr) {
        int i = this.m_pointCount;
        if (pointArr.length < i) {
            throw new IllegalArgumentException();
        }
        for (int i2 = 0; i2 < i; i2++) {
            pointArr[i2] = getPoint(i2);
        }
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void queryCoordinates(Point2D[] point2DArr) {
        int i = this.m_pointCount;
        if (point2DArr.length < i) {
            throw new IllegalArgumentException();
        }
        for (int i2 = 0; i2 < i; i2++) {
            point2DArr[i2] = getXY(i2);
        }
    }

    @Override // com.esri.core.geometry.MultiVertexGeometry
    public void queryCoordinates(Point3D[] point3DArr) {
        int i = this.m_pointCount;
        if (point3DArr.length < i) {
            throw new IllegalArgumentException();
        }
        for (int i2 = 0; i2 < i; i2++) {
            point3DArr[i2] = getXYZ(i2);
        }
    }
}
